mixin frontpage-content(data)
  - let {tutorialTree, topArticlesRendered} = data;

  mixin partList(children)
    each topicSlug in children
      - let topic = tutorialTree.bySlug(topicSlug)
      +e.item
        +e.title
          +e('a').link(href=topic.getUrl())= topic.title
        +b('ul').list-sub
          each subtopicSlug, i in topic.children
            - let subTopic = tutorialTree.bySlug(subtopicSlug);
            +e('li').item(class= (i > 5) ? '_phone_hidden' : '')
              +e.title
                +e('a').link(href=subTopic.getUrl())= subTopic.title
          if (topic.children.length > 6)
            +e('li').more= t('tutorial.more')

  +b.frontpage-content

    +e.container
      - let folder = tutorialTree.bySlug('js')
      +e.inner
        +e.part= t('tutorial.part', {num: 1})
        +e.title= folder.title
        +e.description!= topArticlesRendered.js.content
        +b.list
          +partList(folder.children)

    +e.container
      - let folder = tutorialTree.bySlug('ui')
      +e.inner
        +e.part= t('tutorial.part', {num: 2})
        +e.title= folder.title
        +e.description!= topArticlesRendered.ui.content
        +b.list
          +partList(folder.children)


    +e.container
      +e.inner
        +e.part= t('tutorial.part', {num: 3})
        +e.title= t('tutorial.part3.title')
        +e.description!= t('tutorial.part3.content')
        +b.list
          +partList(tutorialTree.roots.slice(2))

